<extend file='resource/admin/wechat'/>
<block name="content">
	<!-- TAB NAVIGATION -->
	<ul class="nav nav-tabs" role="tablist">
		<li class="active"><a href="{{url('wx.index','base')}}">微信基本消息管理</a></li>
		<li><a href="{{url('wx.post','base')}}" >添加基本回复</a></li>
	</ul>
	<table class="table table-hover">
		<thead>
		<tr>
			<th width="8%">编号</th>
            <th>关键字</th>
			<th>回复内容</th>
            <th>添加时间</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		<foreach from="$field" value="$d">
			<tr>
				<td>{{$d['id']}}</td>
                <td>{{$d->keywords->keywords}}</td>
				<td>{{$d['content']}}</td>
                <td>{{$d['created_at']}}</td>
				<td>
					<div class="btn-group btn-group-sm">
                        <a href="{{url('wx.post','',['id'=>$d['id']])}}" class="btn btn-success">编辑</a>
						<a href="javascript:;" class="btn btn-danger" onclick="del({{$d['id']}})">删除</a>
					</div>
				</td>
			</tr>
		</foreach>
		</tbody>
	</table>

    {{$field->links()}}
<!--    //删除的js代码-->
    <script>
        function del(id){
            util.confirm('确定删除吗?',function(res){
                location.href="{{url('wx.del','base')}}&id="+id;
            })
        }
    </script>








</block>
